package TelitPy;
/**
 * 
 */

import COMM232.*;

/**
 * @author Administrador
 *
 */
public class Main
{

	private DriverSerial driver;
	
	private Receiver rec;
	
	private Sender sen;
	
	private TimeOut timeOut;
	
	public Main()
	{
		Utils u = new Utils('>', '\n', '\r');
		timeOut = new TimeOut();
		try
		{
			driver = new DriverSerial(u);
			rec = new Receiver(driver, timeOut);
			sen = new Sender(driver, timeOut);
			driver.addDriverListener(rec);
			SerialParameters param = new SerialParameters("COM1");
			driver.open(param);
			BootLoader boot = new BootLoader(driver, "0.bin");
			//sen.send("D 400\r");
		}
		catch (ParametersException e)
		{
			e.printStackTrace();
		}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		new Main();
	}

}
